import request from '@/config/axios'

// 话术流程 VO
export interface ProcessVO {
  id: number // 流程id
  name: string // 流程名称
  info: string // 会话id
  record: string // 流程记录
  remark: string // 备注
}

// 话术流程 API
export const ProcessApi = {
  // 查询话术流程分页
  getProcessPage: async (params: any) => {
    return await request.get({ url: `/system/process/page`, params })
  },

  // 查询话术流程详情
  getProcess: async (id: number) => {
    return await request.get({ url: `/system/process/get?id=` + id })
  },

  // 新增话术流程
  createProcess: async (data: ProcessVO) => {
    return await request.post({ url: `/system/process/create`, data })
  },

  // 修改话术流程
  updateProcess: async (data: ProcessVO) => {
    return await request.put({ url: `/system/process/update`, data })
  },

  // 删除话术流程
  deleteProcess: async (id: number) => {
    return await request.delete({ url: `/system/process/delete?id=` + id })
  },

  // 导出话术流程 Excel
  exportProcess: async (params) => {
    return await request.download({ url: `/system/process/export-excel`, params })
  },
}